// 包的入口文件

function dateFormat(dataStr){

  const dt = new Date(dataStr)
    
  const year = dt.getFullYear()
  const month = padZero(dt.getMonth()+1)
  const day = padZero(dt.getDay())

  const hour = padZero(dt.getHours())
  const minute = padZero(dt.getMinutes())
  const secound = padZero(dt.getSeconds())
  
  return `${year}-${month}-${day} ${hour}:${minute}:${secound}`
}

// 补零函数
function padZero(n){
   return n>9 ? n : '0'+n 
}

module.exports = {
  dateFormat
}